<?php
/**
 * Created by PhpStorm.
 * User: liang
 * Email:1050187159@qq.com
 * Date: 2018/8/19
 * Time: 13:48
 */
namespace Home\Controller;

class SetController extends BaseController
{
    public function contact()
    {

        $option_id = I('get.id');
        $Option = D('Option');
        $option = $Option->where(array(
            'id' => array('eq',$option_id),
            'is_show' => array('eq',1),
            'navigator_id' => array('eq',5)
        ))->find();
        if (empty($option)) {
            $this->_empty();
        }
        $option['description'] = htmlspecialchars_decode($option['description']);

        $contents = file_get_contents(APP_PATH.'contact.json');
        $contents = htmlspecialchars_decode(json_decode($contents,true));
        $this->assign(array(
            'optionOne'   => $option,
            'contents' => $contents
        ));

        $this->display('web/Set/contact-us');
    }

    public function map()
    {
        $sets = $this->getBasicSet();
        $this->assign(array(
            'address' => $sets['address'],
            'key'      => 'c1e760c06a563538688a251d463337b8'
        ));
        $this->display('web/Set/map');
    }
}